package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.pojo.Order;
import com.zhentao.service.OrderService;
import com.zhentao.mapper.OrderMapper;
import com.zhentao.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【order(订单主表)】的数据库操作Service实现
* @createDate 2025-08-06 11:26:39
*/
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService{
    @Autowired
    OrderMapper orderMapper;
    @Override
    public Result findallorder(Order order) {
        Page<Order> page=new Page<>(order.getPagenum(),order.getPagesize());
        QueryWrapper<Order> queryWrapper=new QueryWrapper<>();
        queryWrapper.like(order.getOrderNo()!=null,"order_no",order.getOrderNo());
        orderMapper.selectPage(page,queryWrapper);
        List<Order> list=page.getRecords();
        return Result.OK(page);
    }
}




